package com.zerox.mapper;

import com.zerox.entity.SysUser;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface SysUserMapper {
    List<SysUser> list();

    SysUser login(@Param("login_name") String login_name,@Param("password") String password);

    List<SysUser> listUser(@Param("startIndex") Integer startIndex, @Param("pageSize") Integer pageSize, @Param("userName") String userName, @Param("roleId") Integer roleId);

    Integer count(@Param("userName") String userName,@Param("roleId") Integer roleId);


    int add(SysUser sysUser);

//    @Insert("INSERT INTO `run`.`sys_user_role` (user_id) SELECT user_id FROM `run`.`sys_user` ORDER BY user_id DESC LIMIT 1;")
//    int addrelevancy();

    int toAddRole(@Param("userId") Integer userId,@Param("roleId") Integer roleId );

    List<SysUser> toSelectUserDesc();


    int delete(Integer uerId);


    SysUser userById(Integer id);

    int update (SysUser sysUser);

    int add2(SysUser sysUser);





}
